<?php

	class cct_member extends ctl_member
	{
		/*
		function cct_member(&$system)
		{
			parent::ctl_member($system);
			$this->map[] = array('label'=>'批发通道',
								'items'=>array(
										array('label'=>'申请批发会员','link'=>'pf_add'),
										array('label'=>'查看审核状态','link'=>'pf_status'),
								)
                );
		}
		*/

		function pf_add( )
		{
			$oMem = $this->system->loadmodel("member/member");
			$memInfo = $oMem->getFieldById($this->member['member_id']);
			$this->pagedata['memberid'] = $memInfo['member_id'];
			$this->pagedata['name'] = $memInfo['name'];
			$this->pagedata['uname'] = $memInfo['uname'];
			$this->pagedata['level_id'] = $memInfo['member_lv_id'];
			$this->pagedata['email'] = $memInfo['email'];
			$this->pagedata['b_year'] = $memInfo['b_year'];
			$this->pagedata['b_month'] = $memInfo['b_month'];
			$this->pagedata['b_day'] = $memInfo['b_day'];
			$this->_output();
		}

		function pf_status()
		{
			$oMem = $this->system->loadmodel("member/member");
			$memInfo = $oMem->getFieldById($this->member['member_id']);
			$this->pagedata['pass_status'] = $memInfo['pass_status'];		//0审核中,1审核未通过,2审核通过
			$this->_output();
		}

		function pf_save()
		{
			$this->begin($this->system->mkUrl('member','pf_status'));
			$oPifa = $this->system->loadModel('member/pifa');
			$this->end($oMemWholesale->save($this->member['member_id'],$_POST),'申请提交成功');
		}

		function _output()
		{
			$oMem = $this->system->loadmodel("member/member");
			$memInfo = $oMem->getFieldById($this->member['member_id']);
			if ($memInfo != 2)
			{
				$this->map[] = array('label'=>'批发通道',
								'items'=>array(
										array('label'=>'申请批发会员','link'=>'pf_add'),
										array('label'=>'查看审核状态','link'=>'pf_status'),
									)
							 );
			}
		}


	}

?>